IMAGES
An image is simply a rectangular graphics object. Images are key component of web design.
Image classes:
CropImageFilter
FilteredImageSource
ImageFilter
MemoryImageSource
PixelGrabber
RGBImageFilter
Interfaces:
ImageConsumer
ImageObserver
ImageProducer
Methods:
getImage( )
Image getImage(URL)
Image getImage(URL,string)
DrawImage:
It is used to display the images.
boolean drawImage(Imageobject,left,top,image observer)
WRITE A PROGRAM TO LOAD AN IMAGE.
import java.awt.*;
import java.applet.*;
public class VisionImage extends Applet
{
Image img;
public void init()
{
img=getImage(getDocumentBase(),getParameter("img"));
}
public void paint(Graphics g)
{
g.drawImage(img,0,0,this);
}
}
/*
<applet code="VisionImage" width=500 height=400>
<param name="img" value="team.jpg">
</applet>
*/